package com.zpark.oop.day05;

/**
 * @PackageName: com.zpark.oop.day05
 * @ClassName: Person
 * @Description:
 * @author: RZS
 * @date: 2024/10/12  8:38
 */
public class Person {

    String name;

    public Person(String name){
        System.out.println("Person的无参构造方法");
    }

    public int eat(){
        System.out.println("Person 吃东西");
        return 1;
    }

    public Person run(){
        return null;
    }

    /**
     * 要求用户传递数组和获取数组元素的索引
     * 最后返回数组指定索引的元素
     */
    int test(int[] arr, int index) throws ArrayIndexOutOfBoundsException {
        return arr[index];
    }

    // public   protected   default    private

}
